package com.petlab.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.petlab.dao.CommonNewsGroupDao;
import com.petlab.dao.Dao;
import com.petlab.model.CommonNewsGroup;

@Component("commonNewsGroupDao")
public class CommonNewsGroupDaoImpl implements CommonNewsGroupDao {

	private Dao dao;

	public Dao getDao() {
		return dao;
	}

	@Resource
	public void setDao(Dao dao) {
		this.dao = dao;
	}

	public void createNewCommonNewsGroup(CommonNewsGroup commonNewsGroup) {
		dao.add(commonNewsGroup);

	}

	public void deleteCommonNewsGroup(CommonNewsGroup commonNewsGroup) {
		dao.delete(commonNewsGroup);

	}

	public List<CommonNewsGroup> getAllCommonNewsGroup() {
		return dao.findAll(CommonNewsGroup.class);

	}

}
